package com.dayu.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author dayu
 * @version 1.0
 * @email dayu007@foxmail.com
 * @date 2021/3/15 21:43
 * @description
 */
@Data
public class UserRegistVo {

    @NotNull(message = "用户名必须提交")
    @Length(min = 6,max = 18,message = "用户名长度必须是6-18个字节")
    private String userName;

    @NotNull(message = "密码必须提交")
    @Length(min = 6,max = 18,message = "密码长度必须是6-18个字节")
    private String password;

    @NotNull(message = "手机号必须提交")
    @Pattern(regexp = "^1([3-9])[0-9]{9}$",message = "手机号格式不正确")
    private String phone;

    @NotEmpty(message = "验证码必须填写")
    private String code;
}
